#!/bin/python

import os, sys

def main():
    f = open("./jp.txt", "r")
    jp = f.read()
    f.close()
    f = open("./cn*.txt", "r")
    cn = f.read()
    f.close()

    with open(sys.argv[1], "r", encoding="utf-16-le") as f:
        txt = f.read()

    new_filename = input("请输入新文件名: ")  # 获取新文件名

    for i in range(0, len(cn)):
        if jp[i] == '\n':
            continue
        txt = txt.replace(cn[i], jp[i])

    with open(new_filename, "w") as f:
        f.write(txt)

main()
